package com.newlink.building.common_base.utils

import android.content.Context
import android.util.Log
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.GoogleApiAvailability

/**
 * Created by xiaodong on 2022/9/2.
 */
object GooglePlayUtil {

    /**
     * 检查 Google Play 服务
     */
    fun onCheckGooglePlayServices(context: Context): Boolean {
        // 验证是否已在此设备上安装并启用Google Play服务，以及此设备上安装的旧版本是否为此客户端所需的版本
        val code: Int = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context)
        Log.e("GooglePlayUtil", "onCheckGooglePlayServices code: $code")
        return code == ConnectionResult.SUCCESS;
    }

}